<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="css/style.css" />
        <title>Gestion des stocks</title>
    </head>
   <body>
        <?php
       session_start();
       ?>
        <header>
            
            
            <div id='cssmenu'>
<ul>
   <li><a href='index.html'><span>accueil</span></a></li>
   <li><a href='index.php?page=materiel'><span>Créer un nouveau matériel</span></a></li>
   <li><a href='index.php?page=listerMateriel'><span>Voir le stock</span></a></li>
   
    <?php
            if (empty($_SESSION['pseudo'])) {
            echo "<li><a href='index.php?page=connexion'><span>connexion</span></a></li>
         <li class='last'><a href='index.php?page=inscrire'><span>s'enregistrer</span></a></li>
   </li>";
       }
            else {
                
                echo "<br/><li class='last'><a href='index.php?page=deconnexion'><span>déconnexion</span></a></li>";
                echo 'Bienvenue ' . $_SESSION['pseudo'];
                
            }
            ?>
</ul>
</div>
            
            
            
            
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" type="text/javascript"></script>
            <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
            <script src="js/jquery.validationEngine-fr.js" type="text/javascript" charset="utf-8"></script>
            <script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
            <script src="js/function.js" type="text/javascript" charset="utf-8"></script>
            <link rel="stylesheet" href="css/slyle.css" />
            <link rel="stylesheet" href="css/validationEngine.jquery.css" />
           
<div id="connexion">

              
</div>
            
          <div id="erreur">
          
              <?php
              if (isset($_GET["erreur"]))
              {
                  switch($_GET["erreur"]) {
                      case "noco":
                          echo "vous n'êtes pas connecté";
                          break;
                      case "noadmin":
                          echo "vous n'éte pas administrateur";
                          break;
                  }
              }
              
              ?>
          
          </div>
        </header>
        
        <div id="content">
        <?php
        include '/pdo/pdo_materiel.php';
        if(isset($_GET["page"]))
        {
            switch($_GET["page"]){
            
            case "accueil":
                include("pages/accueil.html");
                break;
             case "deconnexion":
                include ("pages/validation/deconnexion.php");
                break;
            case "materiel":
                include ("pages/vue/materiel.php");
                break;
            case "validerMateriel":
                include ("pages/validation/validermateriel.php");
                break;           
            case "listerMateriel":
                include ("pages/vue/listermateriel.php");
                break;
            case "supprimer":
                deleteMateriel($_GET["reference"]);
                include ("pages/vue/listermateriel.php");
                break;
            case "modifier":
                include ("pages/vue/modifiermateriel.php");
                break;
            case "validermodification":
                include ("pages/validation/validermodification.php");
                break;
            case "inscrire":
                include ("pages/vue/inscription.php");
                break;
            case "validerinscr":
                include ("pages/validation/validerinscr.php");
                break;
            case "connexion":
                include ("pages/vue/connexion.php");
                break;
            case "validerco":
                include ("pages/validation/validerconnexion.php");
                break;
            case "miniature":
                include ("pages/validation/creationphoto.php");
                break;
            }
        }
        else 
        {
            include("pages/accueil.html");
        }
        ?>
        </div>
        <footer>
            Site de gestion de stock crée par Imed Edine GANA et Yann DELÉPINE.
        </footer>
    </body>

</html>